<!DOCTYPE html>
<html lang="zh-Hans-CN">
    <head>
        <title>多线程处理实例</title>
        <meta charset="utf-8" />
        <meta name="keywords" content="" />
        <meta name="description" content="" />
        <meta name="author" content="chen" />
        <meta name="viewport" content="width=device-width, initial-scale=1" />
        <meta http-equiv="X-UA-Compatible" content="ie=edge, chrome=1" />
        <!--
            <link rel="stylesheet" type="css/text" media="screen and ( min-width: 1200px )" href="">
        -->
        <link rel="stylesheet" type="text/css" media="screen" href="" />
        <script defer="defer" src=""></script>
        <style>
            /*@import url("css/name.css") screen and ( min-width: 1200px );*/
        </style>
    </head>

    <body>
        <div id="box"></div>
        <script>
            // 本实例是浏览器将大量ASCII码转换成字符

            document.onclick = function() {
                // 启动计时
                console.time(1);

                let str = new String();
                for (let i = 0; i < 50000; i++) {
                    str += String.fromCharCode(i);
                }
                box.innerText = str;

                // 结束计时
                console.time(1);

                // 实测耗时16.7ms
            };
        </script>
    </body>
</html>
